﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFIDA.U9.CBO.Pub.Controller;

namespace JGSoft.U9CRTAPIEX.Public
{
    public static class PublicMethod
    {
        public static string StringJoin(IEnumerable<string> args)
        {
            return string.Join(",", args.Select(t => $"'{t}'"));
        }
        public static void WriteContext(string _userCode, string _entCode, string _orgCode, string paras, string controllerName)
        {
            ContextDTO tdto = new ContextDTO();
            tdto.UserCode = _userCode;//取接口传入的用户编码
            tdto.EntCode = _entCode;//取接口传入的企业编码
            tdto.CultureName = "zh-CN";//固定
            tdto.OrgCode = _orgCode;//取接口传入的组织编码
            tdto.WriteToContext();
            LogManager.WriteLog(paras, controllerName);
        }
    }
}
